package com.fosss.band.controller;

import com.fosss.band.service.FanService;
import com.fosss.band.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author: fosss
 * Date: 2024/1/7
 * Time: 20:50
 * Description:
 */
@Api(tags = "乐迷相关接口")
@Slf4j
@RestController
@RequestMapping("/fan")
public class FanController {

    @Resource
    private FanService fanService;

    @ApiOperation("分页条件查询")
    @GetMapping("/getPageByCondition/{page}/{size}")
    public Result getPageByCondition(@PathVariable("page") Integer page, @PathVariable("size") Integer size,
                                     @RequestParam String keyword) {
        log.info("分页条件查询");
        return fanService.getPageByCondition(page, size, keyword);
    }

    @ApiOperation("删除乐迷（管理员才有的权力）")
    @GetMapping("/delete/{id}")
    public Result delete(@PathVariable("id") Integer id) {
        log.info("删除乐迷（管理员才有的权力）:{}", id);
        return fanService.delete(id);
    }
}

















